using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;

namespace FBPChaos
{
	public class Cursor
	{
		Color cursorColour;
		string modelName;
		int positionX;
        int positionY;
        int maxHeight;
        int maxWidth;
        bool active;

        int rangeLimit;


        public Cursor(int gridHeight, int gridWidth)
        {
            positionX = 0;
            positionY = 0;
            active = false;
            maxHeight = gridHeight;
            maxWidth = gridWidth;
            cursorColour = Color.LightYellow;
            rangeLimit = 1;
        }
        
        public bool moveCursorUp()
		{
            //Moves cursor up.  Returns false if at limit            
            if (positionY != 1)
            {
                positionY = positionY - 1;
                return true;
            }
            else
                return false;
		}

        public void show()
        {
            active = true;
        }

        public void hide()
        {
            active = false;
        }

        public bool moveCursorDown()
        {
            //Moves cursor down.  Returns false if at limit 
            if (positionY < maxHeight)
            {
                positionY = positionY + 1;
                return true;
            }
            else
                return false;
        }
        
        public bool moveCursorLeft()
        {
            if (positionX != 1)
            {
                positionX = positionX-1;
                return true;
            }
            else
                return false;
        }

        public bool moveCursorRight()
        {
            if (positionX < maxWidth)
            {
                positionX = positionX + 1;
                return true;
            }
            else
                return false;
        }
 
        public Point select()
		{
			return Position;
		}

        public int PositionX
        {
            get { return positionX; }
            set { positionX = value; }
        }
        
        public int PositionY
        {
            get { return positionY; }
            set { positionY = value; }
        }

        public Point Position
        {
            get { return new Point(positionX, positionY); }
            set { positionX = value.X; positionY = value.Y; }
        }

        public bool Active
        {
            get { return active; }
            set { active = value; }
        }

        public Color Colour
        {
            get { return cursorColour; }
        }
	}
}
